package com.it.commicity.service.impl.sys;

import com.it.commicity.domain.po.SysRoleMenu;
import com.it.commicity.mapper.sys.SysRoleMenuMapper;
import com.it.commicity.service.sys.ISysRoleMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色和菜单关联表 服务实现类
 * </p>
 *
 * @author author
 * @since 2025-07-11
 */
@Service
public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRoleMenu> implements ISysRoleMenuService {
    @Autowired
    private SysRoleMenuMapper roleMenuMapper;

    /**
     * 根据当前登录用户id查询角色菜单权限
     *
     * @param userId
     * @return
     */
    @Override
    public List<SysRoleMenu> selectRoleMenuByUserId(Long userId) {
        return roleMenuMapper.selectRoleMenuByUserId(userId);
    }
}
